/**
 * 
 */
package co.fitstart.entity.order;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author dan
 *
 */
@Alias("orderPriceType")
public enum OrderPriceType {
    
    SALE("sale", "购买"),
    
    REFUND("refund", "退款");
    
    
    private String alias;

    private String description;

    /**
     * @param alias
     * @param description
     * @param css
     */
    OrderPriceType(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static OrderPriceType aliasOf(String alias) {
        for(OrderPriceType orderStatus : OrderPriceType.values()) {
            if(orderStatus.getAlias().equalsIgnoreCase(alias)){
                return orderStatus;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isSale() {
        return this.equals(SALE);
    }
    
    /**
     * 
     * @return
     */
    public boolean isRefund() {
        return this.equals(REFUND);
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @param alias the alias to set
     */
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
    
}
